
<!--发通知内容-->
<template>
  <div class="sendnotice">
    <div v-if="!isShowCheckbox">
      <van-cell-group>
        <van-field
          v-model="username"
          required
          clearable="true"
          label="通知标题"
          placeholder="请输入通知标题"
          @click-right-icon="$toast('question')"
        />
        <van-field
          label="接收对象"
          required
          readonly
          clickable
          :value="msg"
          right-icon="arrow"
          placeholder="请选择接收对象"
          @click.stop="showCheck"
        />
        <radiocomponent></radiocomponent>
        <datetimepicker></datetimepicker>
      </van-cell-group>
      <van-cell-group style="margin-top:10px;">
        <van-field
          v-model="ly"
          label="通知内容"
          type="textarea"
          placeholder="请填写通知内容"
          rows="4"
          autosize
          required
          clearable="true"
        />
      </van-cell-group>
      <van-cell-group style="margin-top:10px; padding: 10px;">
        <uploadercomponent></uploadercomponent>
      </van-cell-group>
      <div style="margin-top:15px;padding:5px">
        <van-button type="primary" @click="subimt" color="#704485" size="large">保存</van-button>
      </div>
    </div>
    <checkcomponent @back="listenBack" @check="listenCheck" v-else></checkcomponent>
  </div>
</template>
<script>
import datetimepicker from "../../../components/Datetimepicker.vue";
import radiocomponent from "../../../components/Radiocomponent.vue";
import checkcomponent from "../../../components/Checkcomponent.vue";
import uploadercomponent from "../../../components/Uploadercomponent.vue";

export default {
  components: {
    datetimepicker,
    radiocomponent,
    uploadercomponent,
    checkcomponent
  },
  data() {
    return {
      username: "",
      msg: "",
      ly: "",
      isShowCheckbox:false,
    };
  },
  methods: {
    subimt() {
      console.log("保存");
    },
    showCheck(){
      this.isShowCheckbox = true;
    },
    listenBack(val){
      this.isShowCheckbox = val;
    },

    // 部门人员选择监听
    listenCheck(data){
      console.log(data);
      this.msg = data.msg;
      this.listenBack(false);
    }
  }
};
</script>
<style lang="less" scoped>
.sendnotice {
  background-color: #e5e5e7;
  .van-button__text {
    color: #fff !important;
  }
}
</style>